<?php


namespace app\admin\validate;


use think\Validate;

class Partner extends Validate
{
    //字段规则
    protected $rule = [
        'name' => 'require|unique:partner',
        'app_id' => 'require',
    ];

    //验证器提示信息
    protected $message = [
        'name.require' => '请输入合作方名字',
        'name.unique' => '合作方名字已经存在',
        'app_id.require' => '请选择合作方app_id',
    ];

    //使用场景
    protected $scene = [
        'add' => ['name', 'app_id'],
        'edit' => ['name' => 'require', 'app_id']
    ];
}